#ifndef __EDIT_BASE__
#define __EDIT_BASE__
#include <QWidget>
#include <QFile>
#include <QTextEdit>
#include "../../unitls/globalsignalmgr.h"
#include "../../unitls/unitls.h"
#include "mplaintextediter.h"

class EditBaseWidget:public QWidget{
    Q_OBJECT
public:
    EditBaseWidget(QString FilePath, QWidget* parent);
    void load_window();
    const QString& get_filename();
    const QString& get_full_filename();
    bool is_file_changed();
    void save_file();
    void update_file_info(QString FilePath);
    virtual void resize_editer(int w, int h); //重写缩放事件
protected:
    QString full_filename;
    QString file_name;
    QString file_content;
    QString file_new_content;
    MPlainTextEditer* text_edit;
    virtual void init_extra_member_val(); //重写自有变量初始化
    void load_file_content();
    virtual void InitUiStyle();// 重写初始布局
private:
    void init_base_member_val();


public slots:
    virtual void file_edited(); //重写编辑状态响应


};

#endif
